//播放春天这个关卡的游戏音乐
const SpringArea = world.addZone({
  selector: "player",
  bounds: new GameBounds3(
    new GameVector3(1, 8, 234),
    new GameVector3(10, 21, 243)
  ),
});

SpringArea.onEnter(async ({ entity }) => {
  if (entity.player) {
    entity.player.music.sample = "audio/春天.mp3";
  }
});

SpringArea.onLeave(async ({ entity }) => {
  if (entity.player) {
    entity.player.music.sample = "";
  }
});

//播放序幕这个关卡的游戏音乐
const BeginningArea = world.addZone({
  selector: "player",
  bounds: new GameBounds3(
    new GameVector3(1, 8, 222),
    new GameVector3(10, 21, 231)
  ),
});
BeginningArea.onEnter(async ({ entity }) => {
  if (entity.player) {
    entity.player.music.sample = "audio/序幕.mp3";
  }
});
BeginningArea.onLeave(async ({ entity }) => {
  if (entity.player) {
    entity.player.music.sample = "";
  }
});

//播放钢琴这个关卡的游戏音乐
const PianoArea = world.addZone({
  selector: "player",
  bounds: new GameBounds3(
    new GameVector3(0, 8, 209),
    new GameVector3(10, 21, 219)
  ),
});

PianoArea.onEnter(async ({ entity }) => {
  if (entity.player) {
    entity.player.music.sample = "audio/Piano.mp3";
  }
});

PianoArea.onLeave(async ({ entity }) => {
  if (entity.player) {
    entity.player.music.sample = "";
  }
});
